home *** CD-ROM | disk | FTP | other *** search
- /* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- % Copyright (C) 1994, by WATCOM International Inc. All rights %
- % reserved. No part of this software may be reproduced or %
- % used in any form or by any means - graphic, electronic or %
- % mechanical, including photocopying, recording, taping or %
- % information storage and retrieval systems - except with the %
- % written permission of WATCOM International Inc. %
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- */
-
- #ifndef _WCONSOLE_HPP_INCLUDED
- #define _WCONSOLE_HPP_INCLUDED
- #pragma once
-
- #ifndef _WNO_PRAGMA_PUSH
- #pragma pack(push,8);
- #pragma enum int;
- #endif
-
- #include <conio.h>
- #include <stdio.h>
-
- #include "wdef.hpp"
-
- #ifndef _WOBJECT_HPP_INCLUDED
- #include "wobject.hpp"
- #endif
- #ifndef _WCOLOR_HPP_INCLUDED
- #include "wcolor.hpp"
- #endif
- #ifndef _WSTRING_HPP_INCLUDED
- #include "wstring.hpp"
- #endif
-
-
- class WCMCLASS WConsole : public WObject {
- WDeclareSubclass( WConsole, WObject );
-
- public:
-
- /**********************************************************
- * Constructors and Destructors
- *********************************************************/
-
- WConsole();
-
- ~WConsole();
-
- /**********************************************************
- * Properties
- *********************************************************/
-
- // BackColor
-
- virtual WBool SetBackColor( const WColor & color );
- virtual WColor GetBackColor();
-
- // CodePage
-
- WBool SetCodePage( WUInt codePage );
- WUInt GetCodePage();
-
- // Columns
-
- WBool SetColumnCount( WUShort columns );
- WUShort GetColumnCount();
-
- // CursorPosition
-
- WBool SetCursorPosition( const WPoint & position );
- WPoint GetCursorPosition();
-
- // CursorSize
-
- WBool SetCursorSize( WUShort size );
- WUShort GetCursorSize();
-
- // CursorVisible
-
- WBool SetCursorVisible( WBool visible );
- WBool GetCursorVisible();
-
- // EchoInput
-
- WBool SetEchoInput( WBool onOff );
- WBool GetEchoInput();
-
- // ForeColor
-
- virtual WBool SetForeColor( const WColor & color );
- virtual WColor GetForeColor();
-
- // LineInput
-
- WBool SetLineInput( WBool onOff );
- WBool GetLineInput();
-
- // MaximumColumns
-
- WUShort GetMaximumColumns();
-
- // MaximumRows
-
- WUShort GetMaximumRows();
-
- // Rows
-
- WBool SetRowCount( WUShort rows );
- WUShort GetRowCount();
-
- // Text
-
- virtual WBool SetText( const WString & str );
- virtual WString GetText();
-
- /**********************************************************
- * Methods
- *********************************************************/
-
- // Create
-
- WBool Create();
-
- // Clear
-
- WBool Clear();
-
- // Destroy
-
- virtual WBool Destroy();
-
- // Flush
-
- WBool Flush();
-
- // Read
-
- WBool Read( WString & buffer );
-
- // RedirectSTDIO
-
- WBool RedirectSTDIO( WBool onOff );
-
- // Write
-
- WBool Write( const WString & buffer );
-
- /**********************************************************
- * Data
- *********************************************************/
-
- private:
- WColor _backColor;
- WULong _foreColorAttr;
- WColor _foreColor;
- WULong _backColorAttr;
- WBool _IORedirected;
- FILE _oldSTDIn;
- FILE _oldSTDOut;
- FILE _oldSTDErr;
- };
-
-
- #ifndef _WNO_PRAGMA_PUSH
- #pragma enum pop;
- #pragma pack(pop);
- #endif
-
- #endif // _WCONSOLE_HPP_INCLUDED
-